package com.ht.impl.drawtool;

import com.mxgraph.model.mxCell;
import com.mxgraph.model.mxGeometry;

import javax.swing.*;
import java.awt.event.MouseEvent;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Dong Shufeng
 *         Date: 2010-6-17
 */
public class RectTool extends DrawTool {

    public RectTool(String style) {
        super(style);
    }

    public void mousePressed(MouseEvent e) {
        if (SwingUtilities.isLeftMouseButton(e)) {
            mxGeometry geometry = new mxGeometry(0, 0, 0, 0);

            cell = new mxCell(null, geometry, style);
            cell.setVertex(true);
            startPoint = e.getPoint();
        }
    }
}
